
import ajax from './axios.js'
// home
export function collectApi () {
  return ajax({ url: '/analysis/collection' })
}
export function purchaseListApi (params) {
  return ajax({
    url: '/purchase/list',
    params
  })
}

export function projectListApi (params) {
  return ajax({
    url: '/project/list',
    params
  })
}

export function supplierListApi (params) {
  return ajax({
    url: '/supplier/list',
    params
  })
}

export function userListApi (params) {
  return ajax({
    url: '/user/list',
    params
  })
}

export function productListApi () {
  return ajax({
    url: '/material/list'
  })
}

export function purchaseInfoApi (id) {
  return ajax({
    url: '/purchase/info',
    params: { id }
  })
}

export function purchaseSaveApi (data) {
  return ajax({
    url: '/purchase/save',
    method: 'post',
    data
  })
}

export function purchaseUpdateApi (data) {
  return ajax({
    url: '/purchase/update',
    method: 'post',
    data
  })
}

export function purchaseApproveApi (data) {
  return ajax({
    url: '/purchase/flow',
    method: 'post',
    data
  })
}

export function purchaseDeleteApi (id) {
  return ajax({
    // 是一个动态路由、接口
    // url: '/purchase/delete/:id',
    url: '/purchase/delete/' + id,
    method: 'post'
  })
}

export function fileUploadApi (data) {
  return ajax({
    url: '/file/upload/photo',
    method: 'post',
    data
  })
}

export function userUpdateApi (data) {
  return ajax({
    url: '/user/update',
    method: 'post',
    data
  })
}

export function base64UploadApi (data) {
  return ajax({
    url: '/base64/upload',
    method: 'post',
    data
  })
}
